package com.sm.service;

import java.util.List;

import com.sm.dao.ActivitiesMapper;
import com.sm.model.Activities;
import com.sm.model.UserActivities;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.sm.dao.UserActivitiesMapper;

@Service
public class UserActivitiesService {

	@Autowired
	private UserActivitiesMapper userActivitiesMapper;
	@Autowired
	private ActivitiesMapper activitiesMapper;
	
	public List<UserActivities> selectByUserId(Integer userId, Integer userActivitiesStatus){
		return userActivitiesMapper.selectByUserId(userId,userActivitiesStatus);
	}
	
	public int insertSelective(UserActivities record) {
		return userActivitiesMapper.insertSelective(record);
	}
	//查询近期活动
	/*public List<Activities> selectActivitiesNow(){

		return activitiesMapper.selectActivitiesNow();
	}*/
	public UserActivities selectActivitiesById(Integer userActivitiesId){

		return userActivitiesMapper.selectActivitiesById(userActivitiesId);
	}
	/*public int insert(UserActivities recode){
		return userActivitiesMapper.insert(recode);
	}*/
     //查询参会券过期活动
	/*public void changeUserActivitiesStatus(){
		List<Activities> activities = activitiesMapper.selectActivitiesBefore();
		for (Activities ac : activities) {
			userActivitiesMapper.updateBeforeUserActivities(ac.getActivitiesId());
		}
	}*/
	public UserActivities getUserActivitiesBefore(){
    return  userActivitiesMapper.getUserActivitiesBefore();
	}

	public List<UserActivities> getUserActivitiesNow(){
		return  userActivitiesMapper.getUserActivitiesNow();
	}

}
